package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "public_key_verify_wrapper",
    srcs = ["public_key_verify_wrapper.cc"],
    hdrs = ["public_key_verify_wrapper.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:crypto_format",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//:public_key_verify",
        "//internal:monitoring_util",
        "//internal:registry_impl",
        "//internal:util",
        "//monitoring",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "public_key_verify_factory",
    srcs = ["public_key_verify_factory.cc"],
    hdrs = ["public_key_verify_factory.h"],
    include_prefix = "tink/signature",
    deps = [
        ":public_key_verify_wrapper",
        "//:key_manager",
        "//:keyset_handle",
        "//:public_key_verify",
        "//:registry",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
    ],
)

cc_library(
    name = "public_key_sign_wrapper",
    srcs = ["public_key_sign_wrapper.cc"],
    hdrs = ["public_key_sign_wrapper.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:crypto_format",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//:public_key_sign",
        "//internal:monitoring_util",
        "//internal:registry_impl",
        "//internal:util",
        "//monitoring",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "public_key_sign_factory",
    srcs = ["public_key_sign_factory.cc"],
    hdrs = ["public_key_sign_factory.h"],
    include_prefix = "tink/signature",
    deps = [
        ":public_key_sign_wrapper",
        "//:key_manager",
        "//:keyset_handle",
        "//:public_key_sign",
        "//:registry",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
    ],
)

cc_library(
    name = "signature_key_templates",
    srcs = ["signature_key_templates.cc"],
    hdrs = ["signature_key_templates.h"],
    include_prefix = "tink/signature",
    visibility = ["//visibility:public"],
    deps = [
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:ecdsa_cc_proto",
        "//proto:ed25519_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:constants",
        "@boringssl//:crypto",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "ecdsa_sign_key_manager",
    srcs = ["ecdsa_sign_key_manager.cc"],
    hdrs = ["ecdsa_sign_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ecdsa_verify_key_manager",
        "//:core/private_key_type_manager",
        "//:public_key_sign",
        "//config:tink_fips",
        "//internal:ec_util",
        "//proto:ecdsa_cc_proto",
        "//subtle:ecdsa_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:input_stream_util",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "ecdsa_verify_key_manager",
    srcs = ["ecdsa_verify_key_manager.cc"],
    hdrs = ["ecdsa_verify_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:core/key_type_manager",
        "//:public_key_verify",
        "//internal:ec_util",
        "//proto:ecdsa_cc_proto",
        "//subtle:ecdsa_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "ed25519_sign_key_manager",
    srcs = ["ed25519_sign_key_manager.cc"],
    hdrs = ["ed25519_sign_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ed25519_verify_key_manager",
        "//:core/private_key_type_manager",
        "//:public_key_sign",
        "//internal:ec_util",
        "//proto:ed25519_cc_proto",
        "//subtle:ed25519_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:input_stream_util",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "ed25519_verify_key_manager",
    srcs = ["ed25519_verify_key_manager.cc"],
    hdrs = ["ed25519_verify_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:core/key_type_manager",
        "//:public_key_verify",
        "//proto:ed25519_cc_proto",
        "//subtle:ed25519_verify_boringssl",
        "//util:constants",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "sig_util",
    srcs = ["sig_util.cc"],
    hdrs = ["sig_util.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:public_key_sign",
        "//:public_key_verify",
        "//util:status",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_sign_key_manager",
    srcs = ["rsa_ssa_pkcs1_sign_key_manager.cc"],
    hdrs = ["rsa_ssa_pkcs1_sign_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pkcs1_verify_key_manager",
        ":sig_util",
        "//:core/private_key_type_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//subtle:rsa_ssa_pkcs1_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_verify_key_manager",
    srcs = ["rsa_ssa_pkcs1_verify_key_manager.cc"],
    hdrs = ["rsa_ssa_pkcs1_verify_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:core/key_type_manager",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:md_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//subtle:rsa_ssa_pkcs1_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@boringssl//:crypto",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "rsa_ssa_pss_sign_key_manager",
    srcs = ["rsa_ssa_pss_sign_key_manager.cc"],
    hdrs = ["rsa_ssa_pss_sign_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pss_verify_key_manager",
        ":sig_util",
        "//:core/key_type_manager",
        "//:core/private_key_type_manager",
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pss_sign_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "rsa_ssa_pss_verify_key_manager",
    srcs = ["rsa_ssa_pss_verify_key_manager.cc"],
    hdrs = ["rsa_ssa_pss_verify_key_manager.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:core/private_key_type_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:md_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pss_verify_boringssl",
        "//util:constants",
        "//util:enums",
        "//util:errors",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:validation",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "signature_config",
    srcs = ["signature_config.cc"],
    hdrs = ["signature_config.h"],
    include_prefix = "tink/signature",
    visibility = ["//visibility:public"],
    deps = [
        ":ecdsa_sign_key_manager",
        ":ecdsa_verify_key_manager",
        ":ed25519_sign_key_manager",
        ":ed25519_verify_key_manager",
        ":public_key_sign_wrapper",
        ":public_key_verify_wrapper",
        ":rsa_ssa_pkcs1_proto_serialization",
        ":rsa_ssa_pkcs1_sign_key_manager",
        ":rsa_ssa_pkcs1_verify_key_manager",
        ":rsa_ssa_pss_proto_serialization",
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        "//:registry",
        "//config:config_util",
        "//config:tink_fips",
        "//proto:config_cc_proto",
        "//util:status",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "signature_pem_keyset_reader",
    srcs = ["signature_pem_keyset_reader.cc"],
    hdrs = ["signature_pem_keyset_reader.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ecdsa_verify_key_manager",
        ":rsa_ssa_pkcs1_sign_key_manager",
        ":rsa_ssa_pkcs1_verify_key_manager",
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        "//:keyset_reader",
        "//internal:ec_util",
        "//internal:rsa_util",
        "//proto:common_cc_proto",
        "//proto:ecdsa_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:pem_parser_boringssl",
        "//util:enums",
        "//util:keyset_util",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "failing_signature",
    srcs = ["failing_signature.cc"],
    hdrs = ["failing_signature.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:public_key_sign",
        "//:public_key_verify",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "signature_parameters",
    hdrs = ["signature_parameters.h"],
    include_prefix = "tink/signature",
    deps = ["//:parameters"],
)

cc_library(
    name = "signature_public_key",
    hdrs = ["signature_public_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":signature_parameters",
        "//:key",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "signature_private_key",
    hdrs = ["signature_private_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":signature_parameters",
        ":signature_public_key",
        "//:key",
        "//:private_key",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "ed25519_parameters",
    srcs = ["ed25519_parameters.cc"],
    hdrs = ["ed25519_parameters.h"],
    include_prefix = "tink/signature",
    deps = [
        ":signature_parameters",
        "//util:statusor",
    ],
)

cc_library(
    name = "ed25519_public_key",
    srcs = ["ed25519_public_key.cc"],
    hdrs = ["ed25519_public_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ed25519_parameters",
        ":signature_public_key",
        "//:partial_key_access_token",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "ed25519_private_key",
    srcs = ["ed25519_private_key.cc"],
    hdrs = ["ed25519_private_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ed25519_public_key",
        ":signature_private_key",
        "//:insecure_secret_key_access",
        "//:partial_key_access_token",
        "//:restricted_data",
        "//internal:ec_util",
        "//util:secret_data",
        "//util:statusor",
        "@boringssl//:crypto",
    ],
)

cc_library(
    name = "ed25519_proto_serialization",
    srcs = ["ed25519_proto_serialization.cc"],
    hdrs = ["ed25519_proto_serialization.h"],
    include_prefix = "tink/signature",
    deps = [
        ":ed25519_parameters",
        ":ed25519_private_key",
        ":ed25519_public_key",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:ed25519_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_parameters",
    srcs = ["rsa_ssa_pkcs1_parameters.cc"],
    hdrs = ["rsa_ssa_pkcs1_parameters.h"],
    include_prefix = "tink/signature",
    deps = [
        ":signature_parameters",
        "//:big_integer",
        "//:parameters",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_public_key",
    srcs = ["rsa_ssa_pkcs1_public_key.cc"],
    hdrs = ["rsa_ssa_pkcs1_public_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":signature_public_key",
        "//:big_integer",
        "//:key",
        "//:partial_key_access_token",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_private_key",
    srcs = ["rsa_ssa_pkcs1_private_key.cc"],
    hdrs = ["rsa_ssa_pkcs1_private_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pkcs1_public_key",
        ":signature_private_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "config_v0",
    srcs = ["config_v0.cc"],
    hdrs = ["config_v0.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:configuration",
        "//signature/internal:config_v0",
        "@com_google_absl//absl/log:check",
    ],
)

cc_library(
    name = "key_gen_config_v0",
    srcs = ["key_gen_config_v0.cc"],
    hdrs = ["key_gen_config_v0.h"],
    include_prefix = "tink/signature",
    deps = [
        "//:key_gen_configuration",
        "//signature/internal:key_gen_config_v0",
        "@com_google_absl//absl/log:check",
    ],
)

cc_library(
    name = "rsa_ssa_pkcs1_proto_serialization",
    srcs = ["rsa_ssa_pkcs1_proto_serialization.cc"],
    hdrs = ["rsa_ssa_pkcs1_proto_serialization.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":rsa_ssa_pkcs1_private_key",
        ":rsa_ssa_pkcs1_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:common_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pss_parameters",
    srcs = ["rsa_ssa_pss_parameters.cc"],
    hdrs = ["rsa_ssa_pss_parameters.h"],
    include_prefix = "tink/signature",
    deps = [
        ":signature_parameters",
        "//:big_integer",
        "//:parameters",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pss_public_key",
    srcs = ["rsa_ssa_pss_public_key.cc"],
    hdrs = ["rsa_ssa_pss_public_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pss_parameters",
        ":signature_public_key",
        "//:big_integer",
        "//:key",
        "//:partial_key_access_token",
        "//subtle:subtle_util",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pss_private_key",
    srcs = ["rsa_ssa_pss_private_key.cc"],
    hdrs = ["rsa_ssa_pss_private_key.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pss_public_key",
        ":signature_private_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:key",
        "//:partial_key_access_token",
        "//:restricted_big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "rsa_ssa_pss_proto_serialization",
    srcs = ["rsa_ssa_pss_proto_serialization.cc"],
    hdrs = ["rsa_ssa_pss_proto_serialization.h"],
    include_prefix = "tink/signature",
    deps = [
        ":rsa_ssa_pss_parameters",
        ":rsa_ssa_pss_private_key",
        ":rsa_ssa_pss_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//:restricted_data",
        "//:secret_key_access_token",
        "//internal:key_parser",
        "//internal:key_serializer",
        "//internal:mutable_serialization_registry",
        "//internal:parameters_parser",
        "//internal:parameters_serializer",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//proto:common_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
    ],
)

# tests

cc_test(
    name = "public_key_verify_wrapper_test",
    size = "small",
    srcs = ["public_key_verify_wrapper_test.cc"],
    deps = [
        ":failing_signature",
        ":public_key_verify_wrapper",
        "//:primitive_set",
        "//:public_key_verify",
        "//internal:registry_impl",
        "//monitoring",
        "//monitoring:monitoring_client_mocks",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "public_key_verify_factory_test",
    size = "small",
    srcs = ["public_key_verify_factory_test.cc"],
    deps = [
        ":ecdsa_verify_key_manager",
        ":public_key_verify_factory",
        ":signature_config",
        "//:crypto_format",
        "//:keyset_handle",
        "//:public_key_verify",
        "//:registry",
        "//proto:ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:test_keyset_handle",
        "//util:test_util",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "public_key_sign_wrapper_test",
    size = "small",
    srcs = ["public_key_sign_wrapper_test.cc"],
    deps = [
        ":failing_signature",
        ":public_key_sign_wrapper",
        "//:crypto_format",
        "//:primitive_set",
        "//:public_key_sign",
        "//internal:registry_impl",
        "//monitoring",
        "//monitoring:monitoring_client_mocks",
        "//util:status",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "public_key_sign_factory_test",
    size = "small",
    srcs = ["public_key_sign_factory_test.cc"],
    deps = [
        ":ecdsa_sign_key_manager",
        ":public_key_sign_factory",
        ":signature_config",
        "//:crypto_format",
        "//:keyset_handle",
        "//:public_key_sign",
        "//:registry",
        "//proto:ecdsa_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:test_keyset_handle",
        "//util:test_util",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ecdsa_verify_key_manager_test",
    size = "small",
    srcs = ["ecdsa_verify_key_manager_test.cc"],
    deps = [
        ":ecdsa_sign_key_manager",
        ":ecdsa_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:ec_util",
        "//proto:ecdsa_cc_proto",
        "//subtle:ecdsa_sign_boringssl",
        "//util:enums",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_verify_key_manager_test",
    size = "small",
    srcs = ["ed25519_verify_key_manager_test.cc"],
    deps = [
        ":ed25519_sign_key_manager",
        ":ed25519_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//:registry",
        "//proto:ed25519_cc_proto",
        "//subtle:ed25519_sign_boringssl",
        "//util:enums",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_verify_key_manager_test",
    size = "large",
    srcs = ["rsa_ssa_pkcs1_verify_key_manager_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_sign_key_manager",
        ":rsa_ssa_pkcs1_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pkcs1_sign_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_verify_key_manager_test",
    size = "large",
    srcs = ["rsa_ssa_pss_verify_key_manager_test.cc"],
    deps = [
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pss_cc_proto",
        "//subtle:rsa_ssa_pss_sign_boringssl",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ecdsa_sign_key_manager_test",
    size = "small",
    srcs = ["ecdsa_sign_key_manager_test.cc"],
    deps = [
        ":ecdsa_sign_key_manager",
        ":ecdsa_verify_key_manager",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:ec_util",
        "//internal:ssl_util",
        "//proto:ecdsa_cc_proto",
        "//subtle:ecdsa_verify_boringssl",
        "//util:enums",
        "//util:istream_input_stream",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_sign_key_manager_test",
    size = "small",
    srcs = ["ed25519_sign_key_manager_test.cc"],
    deps = [
        ":ed25519_sign_key_manager",
        ":ed25519_verify_key_manager",
        "//:public_key_sign",
        "//:registry",
        "//proto:ed25519_cc_proto",
        "//subtle:ed25519_verify_boringssl",
        "//util:enums",
        "//util:istream_input_stream",
        "//util:protobuf_helper",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_sign_key_manager_test",
    size = "large",
    srcs = ["rsa_ssa_pkcs1_sign_key_manager_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_sign_key_manager",
        ":rsa_ssa_pkcs1_verify_key_manager",
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:rsa_ssa_pkcs1_verify_boringssl",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_sign_key_manager_test",
    size = "large",
    srcs = ["rsa_ssa_pss_sign_key_manager_test.cc"],
    deps = [
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        ":signature_key_templates",
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:rsa_util",
        "//internal:ssl_unique_ptr",
        "//proto:rsa_ssa_pss_cc_proto",
        "//subtle:rsa_ssa_pss_verify_boringssl",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "signature_config_test",
    size = "small",
    srcs = ["signature_config_test.cc"],
    tags = ["fips"],
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":rsa_ssa_pkcs1_private_key",
        ":rsa_ssa_pkcs1_public_key",
        ":rsa_ssa_pss_parameters",
        ":rsa_ssa_pss_private_key",
        ":rsa_ssa_pss_public_key",
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        ":signature_config",
        ":signature_key_templates",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:key",
        "//:keyset_handle",
        "//:parameters",
        "//:partial_key_access",
        "//:public_key_sign",
        "//:public_key_verify",
        "//:registry",
        "//:restricted_big_integer",
        "//:restricted_data",
        "//internal:bn_util",
        "//internal:fips_utils",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "//util:test_util",
        "@boringssl//:crypto",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "signature_key_templates_test",
    size = "large",
    srcs = ["signature_key_templates_test.cc"],
    deps = [
        ":ecdsa_sign_key_manager",
        ":ecdsa_verify_key_manager",
        ":ed25519_sign_key_manager",
        ":ed25519_verify_key_manager",
        ":rsa_ssa_pkcs1_sign_key_manager",
        ":rsa_ssa_pss_sign_key_manager",
        ":signature_key_templates",
        "//:core/key_manager_impl",
        "//:core/private_key_manager_impl",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:ecdsa_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "signature_pem_keyset_reader_test",
    size = "large",
    srcs = ["signature_pem_keyset_reader_test.cc"],
    deps = [
        ":ecdsa_verify_key_manager",
        ":rsa_ssa_pss_sign_key_manager",
        ":rsa_ssa_pss_verify_key_manager",
        ":signature_config",
        ":signature_pem_keyset_reader",
        "//:tink_cc",
        "//internal:rsa_util",
        "//internal:ssl_util",
        "//proto:common_cc_proto",
        "//proto:ecdsa_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:pem_parser_boringssl",
        "//util:enums",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "failing_signature_test",
    srcs = ["failing_signature_test.cc"],
    deps = [
        ":failing_signature",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_parameters_test",
    srcs = ["ed25519_parameters_test.cc"],
    deps = [
        ":ed25519_parameters",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_public_key_test",
    srcs = ["ed25519_public_key_test.cc"],
    deps = [
        ":ed25519_public_key",
        "//:partial_key_access",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_private_key_test",
    srcs = ["ed25519_private_key_test.cc"],
    deps = [
        ":ed25519_private_key",
        ":ed25519_public_key",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//internal:ec_util",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "ed25519_proto_serialization_test",
    srcs = ["ed25519_proto_serialization_test.cc"],
    deps = [
        ":ed25519_parameters",
        ":ed25519_private_key",
        ":ed25519_proto_serialization",
        ":ed25519_public_key",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_data",
        "//internal:ec_util",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//proto:ed25519_cc_proto",
        "//proto:tink_cc_proto",
        "//subtle:random",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_parameters_test",
    srcs = ["rsa_ssa_pkcs1_parameters_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        "//:big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_public_key_test",
    srcs = ["rsa_ssa_pkcs1_public_key_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":rsa_ssa_pkcs1_public_key",
        "//:big_integer",
        "//:partial_key_access",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_private_key_test",
    srcs = ["rsa_ssa_pkcs1_private_key_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":rsa_ssa_pkcs1_private_key",
        ":rsa_ssa_pkcs1_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "config_v0_test",
    srcs = ["config_v0_test.cc"],
    deps = [
        ":config_v0",
        ":key_gen_config_v0",
        ":signature_key_templates",
        "//:keyset_handle",
        "//:public_key_sign",
        "//:public_key_verify",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pkcs1_proto_serialization_test",
    srcs = ["rsa_ssa_pkcs1_proto_serialization_test.cc"],
    deps = [
        ":rsa_ssa_pkcs1_parameters",
        ":rsa_ssa_pkcs1_private_key",
        ":rsa_ssa_pkcs1_proto_serialization",
        ":rsa_ssa_pkcs1_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//:restricted_data",
        "//internal:bn_util",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:rsa_ssa_pkcs1_cc_proto",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_parameters_test",
    srcs = ["rsa_ssa_pss_parameters_test.cc"],
    deps = [
        ":rsa_ssa_pss_parameters",
        "//:big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_public_key_test",
    srcs = ["rsa_ssa_pss_public_key_test.cc"],
    deps = [
        ":rsa_ssa_pss_parameters",
        ":rsa_ssa_pss_public_key",
        "//:big_integer",
        "//:partial_key_access",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_private_key_test",
    srcs = ["rsa_ssa_pss_private_key_test.cc"],
    deps = [
        ":rsa_ssa_pss_parameters",
        ":rsa_ssa_pss_private_key",
        ":rsa_ssa_pss_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//internal:bn_util",
        "//internal:ssl_unique_ptr",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "rsa_ssa_pss_proto_serialization_test",
    srcs = ["rsa_ssa_pss_proto_serialization_test.cc"],
    deps = [
        ":rsa_ssa_pss_parameters",
        ":rsa_ssa_pss_private_key",
        ":rsa_ssa_pss_proto_serialization",
        ":rsa_ssa_pss_public_key",
        "//:big_integer",
        "//:insecure_secret_key_access",
        "//:key",
        "//:parameters",
        "//:partial_key_access",
        "//:restricted_big_integer",
        "//:restricted_data",
        "//internal:bn_util",
        "//internal:mutable_serialization_registry",
        "//internal:proto_key_serialization",
        "//internal:proto_parameters_serialization",
        "//internal:serialization",
        "//internal:ssl_unique_ptr",
        "//proto:common_cc_proto",
        "//proto:rsa_ssa_pss_cc_proto",
        "//proto:tink_cc_proto",
        "//util:statusor",
        "//util:test_matchers",
        "@boringssl//:crypto",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest_main",
    ],
)
